﻿<%@ Page Language="C#"%>
<%@ Import Namespace="XProject.DataVisit.Model.Role" %>
<%@ Import Namespace="XProject.DataVisit.Factory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<% 
    var CurrentUser = Session["UserInfo"] as XProject.DataVisit.Model.UserInfo;
    %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>广告管理</title>
    <XProject:ext ID="Ext1" runat="server" />
    <script src="js/SafeModel.js" type="text/javascript"></script>
    <script src="js/Main.js" type="text/javascript"></script>
    <link href="Styles/Main.css" type="text/css" rel="Stylesheet"/>
    <script type="text/javascript">
        var oplist = new Array('about', 'user', 'news', 'mars', 'jielong', 'other','fcgl','fbgl','bbgl','sys','sqd1');
        $(document).ready(function () {
            $('#nav').find("a").click(function () {
                var id = $(this).attr('id');
                var currentclick = this;
                $.each(oplist, function (i, n) {
                    $('#' + n).attr('class', 'inactive');

                    switch (currentclick.innerText) {
                        case "基本信息":
                            {
                                document.getElementById("ry").style.display = "block";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "权限管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "block";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "地区管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "block";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "设备管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "block";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "模版管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "block";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "广告管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "block";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "系统管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "block";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "发布管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "block";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "报表管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "block";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "分成管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "block";
                                document.getElementById("sqd").style.display = "none";
                                break;
                            }
                        case "申请单管理":
                            {
                                document.getElementById("ry").style.display = "none";
                                document.getElementById("qx").style.display = "none";
                                document.getElementById("dq").style.display = "none";
                                document.getElementById("sb").style.display = "none";
                                document.getElementById("mb").style.display = "none";
                                document.getElementById("gg").style.display = "none";
                                document.getElementById("fb").style.display = "none";
                                document.getElementById("sys1").style.display = "none";
                                document.getElementById("bb").style.display = "none";
                                document.getElementById("fc").style.display = "none";
                                document.getElementById("sqd").style.display = "block";
                                break;
                            }
                    }
                });
                $(this).parents("li").attr('class', 'active');
            });
        });
</script>
</head>
<body>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <div id="all">
	<div id="banner"><h1>广用广告管理</h1></div>
    <div id="nav">
    	<ul>
        <% 
            IList<GYMenu> list = DaoFactory.MenuDao.GetParentList();
            for (int i = 0; i < list.Count; i++)
            {
                for (int j = 0; j < CurrentUser.UserRight.Count; j++)
                {
                    if (list[i].PID == CurrentUser.UserRight[j].MenuID)
                    {
                %>
                    <li class="<%=list[i].ClassName%>" id="<%=list[i].NameID%>"><a href="<%=list[i].MenuUrl%>" target="<%=list[i].MenuFm%>"><%=list[i].MenuName%></a></li>
                <%
                    }
                }
            }
        %>
            
        </ul>
    </div>
    <div id="main1">
    	<div id="welcome">欢迎你登录,<font id="uname"></font>! <img src="images/clock.gif" /> 现在时间: <font id="utime"></font></div>
        <div id="adminop">
            <ul>
                <li><a href="#" onclick="ExitSys();">退出管理</a></li>
            </ul>
        </div>
    </div>
</div>
            </td>
        </tr>
        <tr>
            <td style="background:#fff;" valign="top">
                <table cellpadding="3" cellspacing="3" border="0" width="100%">
                    <tr>
                        <td style="width:200px;border:#cccccc 1px solid" valign="top">
                            <%
                                for (int i = 0; i < list.Count; i++)
                                {
                                    if (true)
                                    {
                                        if (list[i].MenuName.Equals("基本信息"))
                                        {
                                             %>
                                            <div id="<%=list[i].ChildMenu[0].ClassName %>" style="display:block">
                                            <%
                                        }
                                        else
                                        {
                                        %>
                                            <div id="<%=list[i].ChildMenu[0].ClassName %>" style="display:none">
                                        <%
                                        }
                                        if (list[i].ChildMenu != null)
                                        {
                                            for (int j = 0; j < list[i].ChildMenu.Count; j++)
                                            {
                                                for (int k = 0; k < CurrentUser.UserRight.Count; k++)
                                                {
                                                    if (list[i].ChildMenu[j].PID == CurrentUser.UserRight[k].MenuID)
                                                    {
                                                %>
                                                    <table cellpadding="2" cellspacing="2" width="94%" border="0" style="border:#cccccc 1px solid;margin-left:6px;margin-top:6px">
                                                        <tr>
                                                            <td style="width:30px;height:30px" align="center"><img src="<%=list[i].ChildMenu[j].MenuImg %>"/></td>
                                                            <td align="left" class="leftment"><a href="<%=list[i].ChildMenu[j].MenuUrl %>" target="<%=list[i].ChildMenu[j].MenuFm %>"><%=list[i].ChildMenu[j].MenuName%></a></td>
                                                        </tr>
                                                    </table>
                                                <%
                                                    }
                                                }
                                            }
                                        }
                                        %>
                                            </div>
                                        <%
                                    }
                                } 
                            %>
                            
                        </td>
                        <td valign="top" id="bd"><iframe width="100%" frameborder="0" id="fm" name="fm" height="100%" src="Introduction/BaseInfo.html"></iframe></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</body>
</html>
